﻿using System;

namespace Mono.Cecil.Cil
{
	// Token: 0x0200013B RID: 315
	public struct VariableIndex
	{
		// Token: 0x1700030D RID: 781
		// (get) Token: 0x06000BCC RID: 3020 RVA: 0x00034EF8 File Offset: 0x000330F8
		public int Index
		{
			get
			{
				bool flag = this.variable != null;
				int value;
				if (flag)
				{
					value = this.variable.Index;
				}
				else
				{
					bool flag2 = this.index != null;
					if (!flag2)
					{
						throw new NotSupportedException();
					}
					value = this.index.Value;
				}
				return value;
			}
		}

		// Token: 0x1700030E RID: 782
		// (get) Token: 0x06000BCD RID: 3021 RVA: 0x0000632B File Offset: 0x0000452B
		internal bool IsResolved
		{
			get
			{
				return this.variable != null;
			}
		}

		// Token: 0x1700030F RID: 783
		// (get) Token: 0x06000BCE RID: 3022 RVA: 0x00006336 File Offset: 0x00004536
		internal VariableDefinition ResolvedVariable
		{
			get
			{
				return this.variable;
			}
		}

		// Token: 0x06000BCF RID: 3023 RVA: 0x00034F48 File Offset: 0x00033148
		public VariableIndex(VariableDefinition variable)
		{
			bool flag = variable == null;
			if (flag)
			{
				throw new ArgumentNullException("variable");
			}
			this.variable = variable;
			this.index = null;
		}

		// Token: 0x06000BD0 RID: 3024 RVA: 0x0000633E File Offset: 0x0000453E
		public VariableIndex(int index)
		{
			this.variable = null;
			this.index = new int?(index);
		}

		// Token: 0x04000746 RID: 1862
		private readonly VariableDefinition variable;

		// Token: 0x04000747 RID: 1863
		private readonly int? index;
	}
}
